#!/usr/bin/env python3
# -*- coding: utf-8 -*-

""" 文件描述内容 """

__auther__ = 'igofishing'


import numpy as np


# 获取连续的数字组成的矩阵
a = np.arange(10).reshape(2, 5)

print(a)

# 对矩阵进行逻辑运算得到新矩阵
b = a > 5
print(b)

print('矩阵的轴数:', b.ndim)
print('矩阵元素的总个数:', b.size)
print('矩阵的形状:', b.shape)

print('-------------------------------------------')


# 运算的结果参与逻辑判断
c = a % 2 > 0

print(c)

print('--------------------aaaaaaaa-----------------------')

a_look = np.arange(20).reshape(5, 4)

print(a_look)


print('--------------------bbbbbbbb-----------------------')

b_look = np.array([[2, 345, 12], [20, 12, 39]], dtype=complex)

print(b_look)


print('--------------------ccccccc-----------------------')


c_look = np.zeros((4, 5))
c_look1 = np.ones((5, 6), dtype=np.int32)
c_look2 = np.empty((5, 3))


print(c_look)
print(c_look1)
print(c_look2)


print('--------------------ccccccc-----------------------')


d_look = np.linspace(0, 20, 17)


def change_d(data):
    return np.sin(data)

print(d_look)

d_look1 = change_d(d_look)

print(d_look1)


print('--------------------ccccccc-----------------------')


e_look = np.arange(1, 5).reshape(2, 2)

print(e_look)

e_look1 = np.array([[2, 5], [1, 3]])

print(e_look1)

print(np.dot(e_look, e_look1))


